/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * facultyMainMenu.java
 *
 * Created on 11 1, 11, 3:25:30 PM
 */
package introsemp;

import java.awt.Color;
import java.awt.event.*;
import javax.swing.*;

/**
 *
 * @author Marit
 */
public class facultyMainMenu extends JPanel {

    /** Creates new form facultyMainMenu */
    JFrame frame;
    public facultyMainMenu() {
        initComponents();
        JLabel bg = new JLabel(new ImageIcon("Images\\facultyMainMenu.png"));
        bg.setSize(930, 686);
        add(bg);
        bg.setVisible(true);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        subjMgmt = new javax.swing.JButton();
        gradeMgmt = new javax.swing.JButton();
        handlesButton = new javax.swing.JButton();
        advisoryButton = new javax.swing.JButton();
        logoutButton = new javax.swing.JButton();

        subjMgmt.setFont(new java.awt.Font("Segoe UI", 1, 15)); // NOI18N
        subjMgmt.setIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\grading system button.png")); // NOI18N
        subjMgmt.setContentAreaFilled(false);
        subjMgmt.setFocusPainted(false);
        subjMgmt.setRolloverIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\hover - grading system button.png")); // NOI18N
        subjMgmt.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                subjMgmtMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                subjMgmtMouseExited(evt);
            }
        });
        subjMgmt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                subjMgmtActionPerformed(evt);
            }
        });

        gradeMgmt.setFont(new java.awt.Font("Segoe UI", 1, 15)); // NOI18N
        gradeMgmt.setIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\grades button.png")); // NOI18N
        gradeMgmt.setContentAreaFilled(false);
        gradeMgmt.setFocusPainted(false);
        gradeMgmt.setRolloverIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\hover - grades button.png")); // NOI18N
        gradeMgmt.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                gradeMgmtMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                gradeMgmtMouseExited(evt);
            }
        });
        gradeMgmt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gradeMgmtActionPerformed(evt);
            }
        });

        handlesButton.setFont(new java.awt.Font("Segoe UI", 1, 15)); // NOI18N
        handlesButton.setIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\handles button.png")); // NOI18N
        handlesButton.setContentAreaFilled(false);
        handlesButton.setFocusPainted(false);
        handlesButton.setRolloverIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\hover - handles button.png")); // NOI18N
        handlesButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                handlesButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                handlesButtonMouseExited(evt);
            }
        });
        handlesButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                handlesButtonActionPerformed(evt);
            }
        });

        advisoryButton.setFont(new java.awt.Font("Segoe UI", 1, 15)); // NOI18N
        advisoryButton.setIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\advisory button.png")); // NOI18N
        advisoryButton.setContentAreaFilled(false);
        advisoryButton.setFocusPainted(false);
        advisoryButton.setRolloverIcon(new javax.swing.ImageIcon("C:\\Users\\Marit\\Documents\\School Sucks\\S.Y. 11-12 Term 2\\INTROSE\\MP\\hover - advisory button.png")); // NOI18N
        advisoryButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                advisoryButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                advisoryButtonMouseExited(evt);
            }
        });
        advisoryButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                advisoryButtonActionPerformed(evt);
            }
        });

        logoutButton.setFont(new java.awt.Font("Verdana", 0, 13)); // NOI18N
        logoutButton.setText("Log out");
        logoutButton.setContentAreaFilled(false);
        logoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(273, 273, 273)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(advisoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(handlesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(subjMgmt, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(gradeMgmt, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(69, 69, 69)
                        .addComponent(logoutButton)))
                .addContainerGap(350, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addComponent(gradeMgmt, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(38, 38, 38)
                .addComponent(advisoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(handlesButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(subjMgmt, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 131, Short.MAX_VALUE)
                .addComponent(logoutButton)
                .addGap(27, 27, 27))
        );
    }// </editor-fold>//GEN-END:initComponents

private void subjMgmtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_subjMgmtActionPerformed
    remove();
    ComponentsUI com = new ComponentsUI(0);
    com.setFrame(frame);
    // TODO add your handling code here:
}//GEN-LAST:event_subjMgmtActionPerformed

private void gradeMgmtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gradeMgmtActionPerformed
    
    remove();
    GradesUI g = new GradesUI(0);
    g.setFrame(frame);
    // TODO add your handling code here:

}//GEN-LAST:event_gradeMgmtActionPerformed

private void handlesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_handlesButtonActionPerformed
    remove();
    ClassUI c = new ClassUI();
    c.setFrame(frame);// TODO add your handling code here:
}//GEN-LAST:event_handlesButtonActionPerformed

private void advisoryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_advisoryButtonActionPerformed
    remove();
    GradeBreakdownUI a = new GradeBreakdownUI(0);
    a.setFrame(frame);// TODO add your handling code here:
}//GEN-LAST:event_advisoryButtonActionPerformed

private void logoutButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutButtonActionPerformed
    JDialog dbox = new JDialog();
    dbox.setSize(400,250);
    int response = JOptionPane.showConfirmDialog(
                    dbox, "Are you sure you want to log out?", " ", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
            if (response == JOptionPane.YES_OPTION ) {
                dbox.dispose();
                System.exit(0);
            } else if (response == JOptionPane.NO_OPTION ) {
                dbox.dispose();
            }    // TODO add your handling code here:
}//GEN-LAST:event_logoutButtonActionPerformed

private void gradeMgmtMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_gradeMgmtMouseEntered
    gradeMgmt.setForeground(Color.orange);// TODO add your handling code here:
}//GEN-LAST:event_gradeMgmtMouseEntered

private void gradeMgmtMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_gradeMgmtMouseExited
    gradeMgmt.setForeground(Color.black);// TODO add your handling code here:
}//GEN-LAST:event_gradeMgmtMouseExited

private void handlesButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_handlesButtonMouseEntered
    handlesButton.setForeground(Color.orange);// TODO add your handling code here:
}//GEN-LAST:event_handlesButtonMouseEntered

private void handlesButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_handlesButtonMouseExited
    handlesButton.setForeground(Color.black);// TODO add your handling code here:
}//GEN-LAST:event_handlesButtonMouseExited

private void subjMgmtMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_subjMgmtMouseEntered
    subjMgmt.setForeground(Color.orange);// TODO add your handling code here:
}//GEN-LAST:event_subjMgmtMouseEntered

private void subjMgmtMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_subjMgmtMouseExited
    subjMgmt.setForeground(Color.black);// TODO add your handling code here:
}//GEN-LAST:event_subjMgmtMouseExited

private void advisoryButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_advisoryButtonMouseEntered
    advisoryButton.setForeground(Color.orange);// TODO add your handling code here:
}//GEN-LAST:event_advisoryButtonMouseEntered

private void advisoryButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_advisoryButtonMouseExited
    advisoryButton.setForeground(Color.black);// TODO add your handling code here:
}//GEN-LAST:event_advisoryButtonMouseExited

public void remove() {
    frame.remove(this);
}
public void setFrame(JFrame frame) {
    this.frame = frame;
    frame.add(this);
    frame.pack();
    frame.toFront();
}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton advisoryButton;
    private javax.swing.JButton gradeMgmt;
    private javax.swing.JButton handlesButton;
    private javax.swing.JButton logoutButton;
    private javax.swing.JButton subjMgmt;
    // End of variables declaration//GEN-END:variables
}
